import axios from '@/libs/api.request';

/**
 * 创建订单
 */
export const createOrder = (data) => {
  return axios.request({
    url: 'Order/create',
    method: 'post',
    data
  })
};
/**
 * 订单详情
 */
export const getOrderDetail = (order_id) => {
  return axios.request({
    url: 'Order/getOrderDetail',
    method: 'get',
    params:{order_id:order_id}
  })
};
/**
 * 订单核销码
 */
export const getOrderUseCode = (order_id) => {
  return axios.request({
    url: 'Order/getOrderUseCode',
    method: 'get',
    params:{order_id:order_id}
  })
};
/**
 * 退款的订单信息
 */
export const getRefundData = (order_id) => {
  return axios.request({
    url: 'Order/getRefundData',
    method: 'get',
    params:{order_id:order_id}
  })
};
/**
 * 申请退款
 */
export const refund = (order_id,type) => {
  return axios.request({
    url: 'Order/refund',
    method: 'get',
    params:{order_id:order_id,type:type}
  })
};

/**
 * 订单详情
 */
export const getOrderList = (params) => {
  return axios.request({
    url: 'Order/getOrderList',
    method: 'get',
    params:params
  })
};


